#include "pagecleanbrake.h"
#include "ui_pagecleanbrake.h"
#include "global_def.h"

PageCleanBrake::PageCleanBrake(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::PageCleanBrake)
{
    ui->setupUi(this);
    setAutoFillBackground(true);  //设置自动填充
    QPalette palette = BKGCLR;
    setPalette(palette);

    setPageActive(false);
}

PageCleanBrake::~PageCleanBrake()
{
    delete ui;
}

void PageCleanBrake::on_Btn_Return_clicked()
{
    emit returnToMaintMenu();
}

void PageCleanBrake::setPageActive(bool xActive)
{
    page_active_ = xActive;
    ui->Btn_CleanBrak->setEnabled(page_active_);
}

void PageCleanBrake::setCleanBrakeStat(bool stat)
{
    ui->CleanBrakeStat->setText(stat?"激活":"未激活");
    ui->Btn_CleanBrak->setChecked(stat);
}

void PageCleanBrake::on_Btn_CleanBrak_clicked(bool checked)
{
    emit signal_CleanBrakeActive(checked);
}
